package com.sskj.wallet.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.lib.bean.PageBean;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.wallet.bean.ChongTiRecordBean;
import com.sskj.wallet.ui.activity.RecordChongtiActivity;


/**
 * @author Hey
 * Create at  2019/06/27
 */
public class RecordChongtiPresenter extends BasePresenter<RecordChongtiActivity> {

    public void getRecord(boolean showLoading, String pid, String type, int page, int size) {
        httpService.getRecorde(pid, type, page, size)
                .tag(this)
                .execute(new JsonCallBack<HttpData<PageBean<ChongTiRecordBean>>>(showLoading ? this : null) {
                    @Override
                    public void onSuccess(Response<HttpData<PageBean<ChongTiRecordBean>>> response) {
                        mView.getRecordOK(response.body().getData().getList());
                    }

                    @Override
                    public void onFinish() {
                        super.onFinish();
                        mView.stopRefresh();
                    }
                });
    }
}
